home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1999 January / PC Plus Super CD No55a (PCP-147A-1-99) (Disc 1) (1998).iso / linux / developers / visualtcl / windows / vtcl / lib / prefs.tcl < prev    next >
Encoding:
Text File  |  1997-09-02  |  7.9 KB  |  208 lines

  1. ##############################################################################
  2. # $Id: prefs.tcl,v 1.8 1997/09/03 04:54:04 stewart Exp $
  3. #
  4. # prefs.tcl - procedures for editing application preferences
  5. #
  6. # Copyright (C) 1996-1997 Stewart Allen
  7. #
  8. # This program is free software; you can redistribute it and/or
  9. # modify it under the terms of the GNU General Public License
  10. # as published by the Free Software Foundation; either version 2
  11. # of the License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program; if not, write to the Free Software
  20. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. ##############################################################################
  23. #
  24.  
  25. proc vTclWindow.vTcl.prefs {{base ""}} {
  26.     if {$base == ""} {
  27.         set base .vTcl.prefs
  28.     }
  29.     if {[winfo exists $base]} {
  30.         wm deiconify $base; return
  31.     }
  32.     ###################
  33.     # CREATING WIDGETS
  34.     ###################
  35.     toplevel $base -class vTcl
  36.     wm transient $base .vTcl
  37.     wm focusmodel $base passive
  38.     wm overrideredirect $base 0
  39.     wm resizable $base 0 0
  40.     wm deiconify $base
  41.     wm title $base "Preferences"
  42.     frame $base.fra18 \
  43.         -borderwidth 1 -height 53 -relief sunken -width 125 
  44.     label $base.fra18.lab32 \
  45.         -relief raised -text {The Basics} 
  46.     checkbutton $base.fra18.che33 \
  47.         -anchor w -highlightthickness 0 -text {Use Balloon Help} \
  48.         -variable vTcl(pr,balloon) 
  49.     checkbutton $base.fra18.che34 \
  50.         -anchor w -highlightthickness 0 -text {Ask for Widget name on insert} \
  51.         -variable vTcl(pr,getname) 
  52.     checkbutton $base.fra18.che35 \
  53.         -anchor w -highlightthickness 0 \
  54.         -text {Save verbose widget configuration} -variable vTcl(pr,fullcfg) 
  55.     checkbutton $base.fra18.che36 \
  56.         -anchor w -highlightthickness 0 -text {Short automatic widget names} \
  57.         -variable vTcl(pr,shortname) 
  58.     checkbutton $base.fra18.che37 \
  59.         -anchor w -highlightthickness 0 -text {Save global variable values} \
  60.         -variable vTcl(pr,saveglob) 
  61.     checkbutton $base.fra18.che39 \
  62.         -anchor w -highlightthickness 0 -text {Window focus selects window} \
  63.         -variable vTcl(pr,winfocus) 
  64.     checkbutton $base.fra18.che40 \
  65.         -anchor w -highlightthickness 0 -text {Window focus selects window} \
  66.         -variable vTcl(pr,winfocus) 
  67.     frame $base.fra18.fra17 \
  68.         -height 5 -relief groove -width 5 
  69.     frame $base.fra20 \
  70.         -borderwidth 1 -height 30 -relief sunken -width 30 
  71.     label $base.fra20.lab22 \
  72.         -relief raised -text {Font Settings} 
  73.     label $base.fra20.lab23 \
  74.         -relief raised -text Dialog -width 7 
  75.     label $base.fra20.lab24 \
  76.         -relief raised -text Fixed -width 7 
  77.     entry $base.fra20.ent25 \
  78.         -textvariable vTcl(pr,font_dlg) -width 8 
  79.     entry $base.fra20.ent26 \
  80.         -textvariable vTcl(pr,font_fixed) -width 8 
  81.     bind $base.fra20.ent26 <Return> {
  82.         option add *vTcl*Text*font $vTcl(pr,font_fixed)
  83.     }
  84.     frame $base.fra21 \
  85.         -borderwidth 1 -height 30 -relief sunken -width 30 
  86.     label $base.fra21.lab41 \
  87.         -relief raised -text {Default Manager}
  88.     radiobutton $base.fra21.rad42 \
  89.         -anchor w -highlightthickness 0 -text Grid -value grid \
  90.         -variable vTcl(pr,manager) -width 5 
  91.     radiobutton $base.fra21.rad43 \
  92.         -anchor w -highlightthickness 0 -text Pack -value pack \
  93.         -variable vTcl(pr,manager) -width 5 
  94.     radiobutton $base.fra21.rad44 \
  95.         -anchor w -highlightthickness 0 -text Place -value place \
  96.         -variable vTcl(pr,manager) -width 5 
  97.     label $base.fra21.lab18 \
  98.         -relief raised -text {Option Encaps} 
  99.     radiobutton $base.fra21.rad19 \
  100.         -anchor w -highlightthickness 0 -text List -value list \
  101.         -variable vTcl(pr,encase) -width 5 
  102.     radiobutton $base.fra21.rad20 \
  103.         -anchor w -highlightthickness 0 -text Braces -value brace \
  104.         -variable vTcl(pr,encase) -width 5 
  105.     radiobutton $base.fra21.rad21 \
  106.         -anchor w -highlightthickness 0 -text Quotes -value quote \
  107.         -variable vTcl(pr,encase) -width 5 
  108.     frame $base.fra21.fra20 \
  109.         -height 5 -width 5 
  110.     frame $base.fra23 \
  111.         -borderwidth 1 -height 30 -relief sunken -width 30 
  112.     button $base.fra23.but18 \
  113.         -command "wm withdraw $base" -highlightthickness 0 -padx 9 \
  114.         -pady 3 -text OK 
  115.     ###################
  116.     # SETTING GEOMETRY
  117.     ###################
  118.     grid columnconf $base 0 -weight 1
  119.     grid $base.fra18 \
  120.         -column 0 -row 0 -columnspan 1 -rowspan 1 -ipadx 5 -padx 5 \
  121.         -pady 5 -sticky nesw 
  122.     grid columnconf $base.fra18 0 -weight 1
  123.     grid rowconf $base.fra18 7 -weight 1
  124.     grid $base.fra18.lab32 \
  125.         -column 0 -row 0 -columnspan 1 -rowspan 1 -padx 5 \
  126.         -pady 5 -sticky nesw 
  127.     grid $base.fra18.che33 \
  128.         -column 0 -row 1 -columnspan 1 -rowspan 1 \
  129.         -sticky nesw 
  130.     grid $base.fra18.che34 \
  131.         -column 0 -row 2 -columnspan 1 -rowspan 1 \
  132.         -sticky nesw 
  133.     grid $base.fra18.che35 \
  134.         -column 0 -row 4 -columnspan 1 -rowspan 1 \
  135.         -sticky nesw 
  136.     grid $base.fra18.che36 \
  137.         -column 0 -row 3 -columnspan 1 -rowspan 1 \
  138.         -sticky nesw 
  139.     grid $base.fra18.che37 \
  140.         -column 0 -row 5 -columnspan 1 -rowspan 1 \
  141.         -sticky nesw 
  142.     grid $base.fra18.che40 \
  143.         -column 0 -row 6 -columnspan 1 -rowspan 1 \
  144.         -sticky nesw 
  145.     grid $base.fra18.fra17 \
  146.         -column 0 -row 7 -columnspan 1 -rowspan 1 \
  147.         -sticky nesw 
  148.     grid $base.fra20 \
  149.         -column 0 -row 1 -columnspan 1 -rowspan 1 -ipadx 5 -padx 5 \
  150.         -pady 5 -sticky nesw 
  151.     grid columnconf $base.fra20 1 -weight 1
  152.     grid $base.fra20.lab22 \
  153.         -column 0 -row 0 -columnspan 2 -rowspan 1 -padx 5 \
  154.         -pady 5 -sticky nesw 
  155.     grid $base.fra20.lab23 \
  156.         -column 0 -row 1 -columnspan 1 -rowspan 1 -padx 5 \
  157.         -pady 5 -sticky nesw 
  158.     grid $base.fra20.lab24 \
  159.         -column 0 -row 2 -columnspan 1 -rowspan 1 -padx 5 \
  160.         -pady 5 -sticky nesw 
  161.     grid $base.fra20.ent25 \
  162.         -column 1 -row 1 -columnspan 1 -rowspan 1 -padx 5 \
  163.         -sticky ew 
  164.     grid $base.fra20.ent26 \
  165.         -column 1 -row 2 -columnspan 1 -rowspan 1 -padx 5 \
  166.         -sticky ew 
  167.     grid $base.fra21 \
  168.         -column 1 -row 0 -columnspan 1 -rowspan 2 -ipadx 5 -padx 5 \
  169.         -pady 5 -sticky nesw 
  170.     grid columnconf $base.fra21 0 -weight 1
  171.     grid rowconf $base.fra21 8 -weight 1
  172.     grid $base.fra21.lab41 \
  173.         -column 0 -row 0 -columnspan 1 -rowspan 1 -padx 5 \
  174.         -pady 5 -sticky nesw 
  175.     grid $base.fra21.rad42 \
  176.         -column 0 -row 1 -columnspan 1 -rowspan 1 \
  177.         -sticky nesw 
  178.     grid $base.fra21.rad43 \
  179.         -column 0 -row 2 -columnspan 1 -rowspan 1 \
  180.         -sticky nesw 
  181.     grid $base.fra21.rad44 \
  182.         -column 0 -row 3 -columnspan 1 -rowspan 1 \
  183.         -sticky nesw 
  184.     grid $base.fra21.lab18 \
  185.         -column 0 -row 4 -columnspan 1 -rowspan 1 -padx 5 \
  186.         -pady 5 -sticky nesw 
  187.     grid $base.fra21.rad19 \
  188.         -column 0 -row 5 -columnspan 1 -rowspan 1 \
  189.         -sticky nesw 
  190.     grid $base.fra21.rad20 \
  191.         -column 0 -row 6 -columnspan 1 -rowspan 1 \
  192.         -sticky nesw 
  193.     grid $base.fra21.rad21 \
  194.         -column 0 -row 7 -columnspan 1 -rowspan 1 \
  195.         -sticky nesw 
  196.     grid $base.fra21.fra20 \
  197.         -column 0 -row 8 -columnspan 1 -rowspan 1 \
  198.         -sticky nesw 
  199.     grid $base.fra23 \
  200.         -column 0 -row 2 -columnspan 2 -rowspan 1 -padx 5 -pady 5 \
  201.         -sticky nesw 
  202.     grid columnconf $base.fra23 0 -weight 1
  203.     grid $base.fra23.but18 \
  204.         -column 0 -row 0 -columnspan 1 -rowspan 1 -padx 3 \
  205.         -pady 3 -sticky nesw 
  206. }
  207.  
  208.